<!DOCTYPE html>
<html>
<head>
    <title></title>
    <style type="text/css">
        canvas {
            border: 1px solid red;
        }
    </style>
    <script src="http://code.jquery.com/jquery-3.2.1.min.js"></script>
</head>
<body onload="draw()">
    <canvas id="mycanvas" height="150" width="150"></canvas>
    <script>
        function draw() {
            const canvasId = $("#mycanvas")[0];
            const ctx = canvasId.getContext && canvasId.getContext("2d");
            for(let i = 0; i < 6; i ++) {
                for(let j = 0; j < 6; j++) {
                    ctx.strokeStyle = `rgb(0, ${Math.floor(255 - 42.5 * i)}, ${Math.floor(255 - 42.5 * j)})`;
                    ctx.beginPath();
                    // 逆时针画圆
                    ctx.arc(12.5 + j * 25, 12.5 + i*25, 10, 0, Math.PI * 2, true);
                    ctx.stroke();
                    // 说明：如果画出的图形是需要填充的就使用fillStyle和fill()，如果是需要描边的就使用strokeStyle和stroke()即可
                }
            }
        }
    </script>
</body>
</html>